import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

//上报任务列表
export function reportList(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/list',
    method: 'post',
    data: data
  })
}

// 上报任务
export function reportAdd(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 查询上报任务详情
export function reportDetail(id) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 上报审核通过
export function reportPass(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/pass',
    method: 'post',
    data: data
  })
}

// 上报审核拒绝
export function reportReject(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/reject',
    method: 'post',
    data: data
  })
}

//上报审核通过，创建任务
export function taskCreate(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/create',
    method: 'post',
    data: data
  })
}

//导出上报任务
export function reportExport(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/export',
    method: 'post',
    data: data
  })
}

//新增任务
export function taskAddOrUpdate(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/addOrUpdate',
    method: 'post',
    data: data
  })
}

//任务中心列表
export function taskList(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/list',
    method: 'post',
    data: data
  })
}

// 查询任务中心任务详情
export function taskDetail(id) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//任务执行
export function taskExecute(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/exec',
    method: 'post',
    data: data
  })
}

//任务转办
export function taskTranfer(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/tranfer',
    method: 'post',
    data: data
  })
}

//任务审核通过
export function taskPass(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/check',
    method: 'post',
    data: data
  })
}

//任务审核拒绝
export function taskReject(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/reject',
    method: 'post',
    data: data
  })
}

//任务暂存
export function taskSave(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/save',
    method: 'post',
    data: data
  })
}

//导出任务
export function taskExport(data) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/order/export',
    method: 'post',
    data: data
  })
}

//下载附件
export function downLoad(id) {
  return request({
    url: GEN_SERVER['form-server'] + '/refine/report/byte/down',
    method: 'get',
    responseType: 'blob',
    params: {
      id
    }
  })
}


